﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.Prism.Regions;
using System.Windows;

namespace Tanmia.Basis.Prism
{
    public class WindowRegionAdapter : RegionAdapterBase<Window>
    {
        public Style WindowStyle { get; set; }

        public WindowRegionAdapter(IRegionBehaviorFactory regionBehaviorFactory)
            : base(regionBehaviorFactory)
        {
        }

        protected override void Adapt(IRegion region, Window regionTarget)
        {

        }

        protected override IRegion CreateRegion()
        {
            return new SingleActiveRegion();
        }

        protected override void AttachBehaviors(IRegion region, Window regionTarget)
        {
            base.AttachBehaviors(region, regionTarget);

            WindowRegionBehavior behavior = new WindowRegionBehavior(regionTarget, WindowStyle);
            behavior.Region = region;
            behavior.Attach();
        }
    }
}
